import { getSystemPath } from './file';

/* 获取文件列表缓存 */
export const sysFileList = ref<Record<string, any>>({});

export const getFileList = async (path: string, onlyFolder: boolean) => {
  if (!sysFileList.value[path]) {
    const { data } = await getSystemPath(path, onlyFolder);
    sysFileList.value[path] = data.data;
    return data.data;
  }
  return sysFileList.value[path];
};
